home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1 / Nebula One.iso / Utilities / Converters / Convert_MacPaint / Source / shared.subproj / RCS / MacToNeXTText.rtf,v < prev    next >
Text File  |  1995-06-12  |  13KB  |  455 lines

  1. head     1.2;
  2. branch   ;
  3. access   ;
  4. symbols  beta10:1.1;
  5. locks    death:1.2;
  6. comment  @@;
  7.  
  8.  
  9. 1.2
  10. date     93.04.04.23.44.39;  author death;  state Exp;
  11. branches ;
  12. next     1.1;
  13.  
  14. 1.1
  15. date     93.01.10.15.08.05;  author death;  state Exp;
  16. branches ;
  17. next     ;
  18.  
  19.  
  20. desc
  21. @@
  22.  
  23.  
  24. 1.2
  25. log
  26. @Sun Apr  4 23:44:39 PDT 1993
  27. @
  28. text
  29. @{\rtf0\ansi{\fonttbl\f0\fnil Palatino-Roman;\f1\ftech Symbol;\f2\fnil Times-Roman;\f3\fnil NewCenturySchlbk-Roman;}
  30. \paperw14520
  31. \paperh13060
  32. \margl120
  33. \margr0
  34. {\colortbl\red0\green0\blue0;}
  35. \pard\tx5700\tx11360\f0\b0\i0\ul0\fs24 $Revision: 1.1 $    $Author: death $    $Date: 93/01/10 15:08:05 $\
  36.  
  37. \pard \
  38.  
  39. \pard\tx3120\tx3620\tx4120\fs16\li2620 \
  40.  
  41. \fs28 \
  42.  
  43. \fs16 \
  44.  
  45. \fs28 \
  46.  
  47. \fs16 \
  48.  
  49. \pard\b\li1100 \
  50. \
  51. \
  52. \
  53.  
  54. \fs36 MacToNeXTText\
  55.  
  56. \fs16 \
  57.  
  58. \pard\tx7140\b0\fs28\li2100 INHERITS FROM    TextConverter\
  59.  
  60. \fs16 \
  61.  
  62. \fs28 DECLARED IN    MacToNeXTText.h\
  63.  
  64. \fs16 \
  65. \
  66. \
  67.  
  68. \fs28 CLASS DESCRIPTION\
  69.  
  70. \fs16 \
  71.  
  72. \pard\tx3120\tx3620\tx4120\fs28\li2620 The MacToNeXTText class serves to convert raw text using the standard Mac character set to the standard NeXT character set.  It accomplishes this by overriding the methods provided by TextConverter class, and introducing its own conversion algorithms instead.  See the TextConverter class document for details about the way one of these classes works.\
  73.  
  74. \fs16 \
  75.  
  76. \fs28 There are zillions of fonts on the Mac.  Apple introduced a set with the Macintosh originally.  The general layout for these type families is defined in Inside Macintosh Volume 1 page 221 (many of the fancy families, like San Francisco, do not have all the characters listed in the table).  With the LaserWriter Plus came several new type families, and these used a superset of the character set defined in Inside Mac.  This class understands the superset used by faces such as Avant Garde, Bookman, etc.  This is just to say that it will do a reasonable job of converting Mac text that was created using any of Apple's type families to NeXT text.  When they extend themselves beyond the basic ASCII character set, third parties, both commercial and non commercial, often create their own character mappings which may or may not have any relation to Apple's.  This class can not garantee to process those correctly.  Recognizing that some fonts may have stuck strictly to the table in Inside Mac, and then done their own thing in the undefined character spaces, this object allows one to toggle a mode with SetMode:.  If passed YES, it will convert only those characters defined in the Inside Mac table.  If NO, it will use the full table as shown in the LaserWriter families.  The default is NO.\
  77.  
  78. \pard\tx7140\fs16\li2100 \
  79.  
  80. \pard\tx3120\tx3620\tx4120\fs28\li2620 A table listing the conversions done by this class is provided at the end.\
  81.  
  82. \fs16 \
  83.  
  84. \pard\tx7140\li2100 \
  85. \
  86.  
  87. \fs28 INSTANCE VARIABLES\
  88.  
  89. \fs16 \
  90.  
  91. \pard\tx7140\tx10180\tx10680\i\fs28\fi-4540\li7140 Declared in MacToNeXTText
  92. \i0     Boolean    strictIM\
  93.  
  94. \pard\tx7140\fs16\li2100 \
  95. \
  96. \
  97.  
  98. \fs28 METHOD TYPES\
  99.  
  100. \fs16 \
  101.  
  102. \pard\tx7140\tx10180\tx10680\fs28\fi-4540\li7140 Initalizing    
  103. \f1 - 
  104. \f0 init
  105. \pard\tx10180\tx10680\f1\fi-520\li7660 \
  106.  
  107. \pard\tx7140\f0\fs16\li2100 \
  108.  
  109. \pard\tx7140\tx10180\tx10680\fs28\fi-4540\li7140 Converting characters    
  110. \f1 - 
  111. \f0 ConvertCharacter:\
  112.  
  113. \pard\tx10180\tx10680\f1\fi-520\li7660 - 
  114. \f2 ConvertString:WithLength:
  115. \f1 \
  116.  
  117. \pard\tx7140\f0\fs16\li2100 \
  118.  
  119. \pard\tx7140\tx10180\tx10680\fs28\fi-4540\li7140 Setting conversion type    
  120. \f1 - 
  121. \f0 SetMode:\
  122.  
  123. \pard\tx7140\fs16\li2100 \
  124. \
  125. \
  126.  
  127. \fs28 CLASS METHODS\
  128.  
  129. \fs16 \
  130.  
  131. \b \
  132.  
  133. \b0\fs28 None\
  134.  
  135. \pard\tx3120\tx3620\tx4120\fs16\li2620 \
  136.  
  137. \pard\tx7140\li2100 \
  138. \
  139.  
  140. \fs28 INSTANCE METHODS\
  141.  
  142. \fs16 \
  143.  
  144. \b \
  145.  
  146. \fs28 ConvertCharacter:\
  147.  
  148. \pard\b0\fi-1020\li3620 - (Character) 
  149. \b ConvertCharacter: 
  150. \b0 (Character) 
  151. \i macChar\
  152.  
  153. \pard\tx3620\i0\fi-380\li3620 0    Result codes and test\
  154. 1    The returned character
  155. \fs16 \
  156.  
  157. \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\b\fi-1020\li3620 \
  158.  
  159. \pard\tx3120\tx3620\tx4120\b0\fs28\li2620 This returns a single character in the NeXTstep character encoding set that most closely matches the specified Macintosh character.  If the match can not be made exactly, this sets the error to 
  160. \fs24 errCANTMAPTOONE.
  161. \fs28 \
  162.  
  163. \pard\tx7140\fs16\li2100 \
  164.  
  165. \b \
  166.  
  167. \fs28 ConvertString:WithLength:\
  168.  
  169. \pard\f1\b0\fi-1020\li3620 - 
  170. \f0 (Pointer) 
  171. \b ConvertString:
  172. \b0  (Pointer) 
  173. \i theData 
  174. \b\i0 WithLength
  175. \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\fi-1020\li3620 :
  176. \b0  (
  177. \pard\fi-1020\li3620 Integer
  178. \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\fi-1020\li3620 ) 
  179. \pard\i\fi-1020\li3620 length
  180. \b\i0 \
  181.  
  182. \pard\tx3620\b0\fi-380\li3620 0    Result codes and test\
  183. 1    The returned Pointer\
  184. 2    The lenght of the returning data
  185. \fs16 \
  186.  
  187. \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\b\fi-1020\li3620 \
  188.  
  189. \pard\tx3120\tx3620\tx4120\b0\fs28\li2620 This behaves as documented in the TextConverter class: it converts data from the source string to a destination string it creates, and it then returns this string with its length.  See the description above, and the table below, for encoding details.  \
  190.  
  191. \pard\tx7140\fs16\li2100 \
  192.  
  193. \b \
  194.  
  195. \fs28 init\
  196.  
  197. \pard\f1\b0\fi-1020\li3620 - 
  198. \f0 (Instance) 
  199. \b init\
  200.  
  201. \pard\tx3620\b0\fi-380\li3620 0    Result codes and test\
  202.  
  203. \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\b\fs16\fi-1020\li3620 \
  204.  
  205. \pard\tx3120\tx3620\tx4120\b0\fs28\li2620 This initalizes the object, including setting its strictIM flag to NO.  \
  206.  
  207. \pard\tx7140\fs16\li2100 \
  208.  
  209. \b \
  210.  
  211. \fs28 UseIM1:\
  212.  
  213. \pard\f1\b0\fi-1020\li3620 - 
  214. \f0 (Instance) 
  215. \b UseIM1:
  216. \b0  (Boolean) 
  217. \i doItStrictly
  218. \b\i0 \
  219.  
  220. \pard\tx3620\b0\fi-380\li3620 0    Result codes and test\
  221.  
  222. \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\b\fs16\fi-1020\li3620 \
  223.  
  224. \pard\tx3120\tx3620\tx4120\b0\fs28\li2620 This allows the caller to specify whether future conversions should use only the table found in Inside Macintosh Volume I, p. 221. or use the character set (which is a superset of the former) used by the families that are used with the LaserWriters.  The only reason to specify YES (i.e. use the restricted IM V1 table) is if one is converting some older text which made use of those upper characters in other ways, and one doesn't want them to be shuffled around.  This is just to say: the odds are REAL good that you won't ever use this.  \
  225.  
  226. \fs16 \
  227.  
  228. \pard\tx7140\b\li2100 \
  229.  
  230. \b0 \
  231.  
  232. \fs28 BUGS AND PROBLEMS\
  233.  
  234. \fs16 \
  235.  
  236. \pard\tx3120\tx3620\tx4120\fs28\li2620 none yet\
  237.  
  238. \fs16 \
  239.  
  240. \pard\tx7140\li2100 \
  241. \
  242.  
  243. \fs28 ENHANCEMENT IDEAS\
  244.  
  245. \fs16 \
  246.  
  247. \pard\tx3120\tx3620\tx4120\fs28\li2620 none\
  248.  
  249. \fs16 \
  250.  
  251. \pard\tx7140\li2100 \
  252. \
  253.  
  254. \fs28 CONSTANT, DEFINED TYPES AND ERROR CODES\
  255.  
  256. \fs16 \
  257.  
  258. \pard\tx6480\tx7180\fs24\fi-3860\li6480 \
  259.  
  260. \pard\tx3120\tx3620\tx4120\tx7220\li2620 #define errCANTMAPTOONE    1001\
  261.  
  262. \pard\tx3120\tx3620\tx4120\fs16\li2620 \
  263.  
  264. \pard\tx7140\li2100 \
  265. \
  266.  
  267. \fs28 CONVERSION TABLE\
  268.  
  269. \fs16 \
  270.  
  271. \pard\tx6480\tx7180\fs24\fi-3860\li6480 \
  272.  
  273. \pard\tx3120\tx3620\tx4120\li2620 Characters from 0x00 to 0x79 are converted exactly as the superclass converts them, with the following exceptions (the second is to convert the line termination character)\
  274.  
  275. \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\b\fs16\fi-1020\li3620 \
  276.  
  277. \pard\tx6480\tx8640\fs24\fi-2880\li6480 Character name    Mac code    NeXT code\
  278.  
  279. \b0\fc0 NUL    0x00    0x00\
  280. CR/LF    0x0C    0x0A\
  281.  
  282. \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\b\fs16\fi-1020\li3620 \
  283.  
  284. \pard\tx3120\tx3620\tx4120\b0\fs24\li2620 Characters above 0x79 are converted as detailed in the following columns.  Note that an entry of `
  285. \fc0 ——' means that the specified Mac character could not be converted.  When this occurrs, the object returns the Mac character code, and sets an error value.  If the strict Inside Mac V. 1 flag is set, then all characters above D8 are returned as themselves with no error (as shown in column 5).  If one uses the ConvertString method, the object returns the values detailed in column 4.  Note that these never return a value of `——', but instead return the name of the character it could not convert. (the values with `——' in the final column will get the strings showin the ConvertString column if this flag is set when calling that method).  Finally note that the first four characters are only actually found in Chicago. However, they shouldn't be turning up, in general, in other fonts, so I took the liberty of including them here. \
  286.  
  287. \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\b\fs16\fi-1020\li3620 \
  288.  
  289. \pard\tx5780\tx7400\tx9020\tx11180\fs24\fi-2160\li5760 Character name    Mac code    NeXT code    ConvertString    With In. Mac flag\
  290.  
  291. \b0\fc0 commandsymbol    0x11    ——    [commandsymbol]    ——\
  292. check    0x12    ——    [check]    ——\
  293. diamond    0x13    ——    [diamond]    ——\
  294. apple    0x14    ——    [apple]    ——\
  295. Adieresis    0x80    0x85    0x85    0x85\
  296. Aring    0x81    0x86    0x86    0x86\
  297. Ccedilla    0x82    0x87    0x87    0x87\
  298. Eacute    0x83    0x89    0x89    0x89\
  299. Ntilde    0x84    0x91    0x91    0x91\
  300. Odieresis    0x85    0x96    0x96    0x96\
  301. Udieresis    0x86    0x9A    0x9A    0x9A\
  302. aacute    0x87    0xD6    0xD6    0xD6\
  303. agrave    0x88    0xD5    0xD5    0xD5\
  304. acircumflex    0x89    0xD7    0xD7    0xD7\
  305. adieresis    0x8A    0xD9    0xD9    0xD9\
  306. atilde    0x8B    0xD8    0xD8    0xD8\
  307. aring    0x8C    0xDA    0xDA    0xDA\
  308. ccedilla    0x8D    0xDB    0xDB    0xDB\
  309. eacute    0x8E    0xDD    0xDD    0xDD\
  310. egrave    0x8F    0xDC    0xDC    0xDC\
  311. ecircumflex    0x90    0xDE    0xDE    0xDE\
  312. dieresis    0x91    0xDF    0xDF    0xDF\
  313. iacute    0x92    0xE2    0xE2    0xE2\
  314. igrave    0x93    0xE0    0xE0    0xE0\
  315. icircumflex    0x94    0xE4    0xE4    0xE4\
  316. idieresis    0x95    0xE5    0xE5    0xE5\
  317. ntilde    0x96    0xE7    0xE7    0xE7\
  318. oacute    0x97    0xED    0xED    0xED\
  319. ograve    0x98    0xEC    0xEC    0xEC\
  320. ocircumflex    0x99    0xEE    0xEE    0xEE\
  321. odieresis    0x9A    0xF0    0xF0    0xF0\
  322. otilde    0x9B    0xEF    0xEF    0xEF\
  323. uacute    0x9C    0xF3    0xF3    0xF3\
  324. ugrave    0x9D    0xF2    0xF2    0xF2\
  325. ucircumflex    0x9E    0xF4    0xF4    0xF4\
  326. udieresis    0x9F    0xF6    0xF6    0xF6\
  327. dagger    0xA0    0xB2    0xB2    0xB2\
  328. degree    0xA1    ——    [degrees]    ——\
  329. cent    0xA2    0xA2    0xA2    0xA2\
  330. sterling    0xA3    0xA3    0xA3    0xA3\
  331. section    0xA4    0xA7    0xA7    0xA7\
  332. bullet    0xA5    0xB7    0xB7    0xB7\
  333. paragraph    0xA6    0xB6    0xB6    0xB6\
  334. germandbls    0xA7    0xFB    0xFB    0xFB\
  335. registerserif    0xA8    0xB0    0xB0    0xB0\
  336. copyrightserif    0xA9    0xA0    0xA0    0xA0\
  337. trademarkserif    0xAA    ——    [trademarkserif]    ——\
  338. acute    0xAB    0xC2    0xC2    0xC2\
  339. dieresis    0xAC    0xC8    0xC8    0xC8\
  340. notequal    0xAD    ——    [notequal]    ——\
  341. AE    0xAE    0xE1    0xE1    0xE1\
  342. Oslash    0xAF    0xE9    0xE9    0xE9\
  343. infinity    0xB0    ——    [infinity]    ——\
  344. plusminus    0xB1    0xD1    0xD1    0xD1\
  345. lessequal    0xB2    ——    [lessequal]    ——\
  346. greaterequal    0xB3    ——    [greaterequal]    ——\
  347. yen    0xB4    0xA5    0xA5    0xA5\
  348. mu    0xB5    0x9D    0x9D    0x9D\
  349. partialdiff    0xB6    ——    [partialdiff]    ——\
  350. summation    0xB7    ——    [summation]    ——\
  351. product    0xB8    ——    [product]    ——\
  352. pi    0xB9    ——    [pi]    ——\
  353. integral    0xBA    ——    [integral]    ——\
  354. ordfeminine    0xBB    0xE3    0xE3    0xE3\
  355. ordmasculine    0xBC    0xEB    0xEB    0xEB\
  356. Omega    0xBD    ——    [Omega]    ——\
  357. ae    0xBE    0xF1    0xF1    0xF1\
  358. oslash    0xBF    0xF9    0xF9    0xF9\
  359. questiondown    0xC0    0xBF    0xBF    0xBF\
  360. exclamdown    0xC1    0xA1    0xA1    0xA1\
  361. logicalnot    0xC2    0xBE    0xBE    0xBE\
  362. radical    0xC3    ——    [radical]    ——\
  363. florin    0xC4    0xA6    0xA6    0xA6\
  364. approxequal    0xC5    ——    [approxequal]    ——\
  365. delta    0xC6    ——    [delta]    ——\
  366. guillemotleft    0xC7    0xAB    0xAB    0xAB\
  367. guillemotright    0xC8    0xBB    0xBB    0xBB\
  368. elipsis    0xC9    0xBC    0xBC    0xBC\
  369. nbspace    0xCA    0x80    0x80    0x80\
  370. Agrave    0xCB    0x81    0x81    0x81\
  371. Atilde    0xCC    0x84    0x84    0x84\
  372. Otilde    0xCD    0x95    0x95    0x95\
  373. OE    0xCE    0xEA    0xEA    0xEA\
  374. oe    0xCF    0xFA    0xFA    0xFA\
  375. endash    0xD0    0xB1    0xB1    0xB1\
  376. emdash    0xD1    0xD0    0xD0    0xD0\
  377. quotedblleft    0xD2    0xAA    0xAA    0xAA\
  378. quotedblright    0xD3    0xBA    0xBA    0xBA\
  379. quoteleft    0xD4    0x60    0x60    0x60\
  380. quoteright    0xD5    0x27    0x27    0x27\
  381. divide    0xD6    0x9F    0x9F    0x9F\
  382. lozenge    0xD7    ——    [lozenge]    ——\
  383. ydieresis    0xD8    0xFD    0xFD    0xFD\
  384. Ydieresis    0xD9    ——    [Ydieresis or a picture] 0xD9\
  385. fraction    0xDA    0xA4    0xA4    0xDA\
  386. currency    0xDB    0xA8    0xA8    0xDB\
  387. guilsinglleft    0xDC    0xAC    0xAC    0xDC\
  388. guilsinglright    0xDD    0xAD    0xAD    0xDD\
  389. fi    0xDE    0xAE    0xAE    0xDE\
  390. fl    0xDF    0xAF    0xAF    0xDF\
  391. daggerdbl    0xE0    0xB3    0xB3    0xE0\
  392. periodcentered    0xE1    0xB4    0xB4    0xE1\
  393. quotesinglebase    0xE2    0xB8    0xB8    0xE2\
  394. quotedblbase    0xE3    0xB9    0xB9    0xE3\
  395. perthousand    0xE4    0xBD    0xBD    0xE4\
  396. Acircumflex    0xE5    0x83    0x83    0xE5\
  397. Ecircumflex    0xE6    0x8A    0x8A    0xE6\
  398. Aacute    0xE7    0x82    0x82    0xE7\
  399. Edieresis    0xE8    0x8B    0x8B    0xE8\
  400. Egrave    0xE9    0x88    0x88    0xE9\
  401. Iacute    0xEA    0x8D    0x8D    0xEA\
  402. Icircumflex    0xEB    0x8E    0x8E    0xEB\
  403. Idieresis    0xEC    0x8F    0x8F    0xEC\
  404. Igrave    0xED    0x8C    0x8C    0xED\
  405. Oacute    0xEE    0x93    0x93    0xEE\
  406. Ocircumflex    0xEF    0x94    0x94    0xEF\
  407. apple    0xF0    ——    [apple]    0xF0\
  408. Ograve    0xF1    0x92    0x92    0xF1\
  409. Uacute    0xF2    0x98    0x98    0xF2\
  410. Ucircumflex    0xF3    0x99    0x99    0xF3\
  411. Ugrave    0xF4    0x97    0x97    0xF4\
  412. dotlessi    0xF5    0xF5    0xF5    0xF5\
  413. circumflex    0xF6    0xC3    0xC3    0xF6\
  414. tilde    0xF7    0xC4    0xC4    0xF7\
  415. macron    0xF8    0xC5    0xC5    0xF8\
  416. breve    0xF9    0xC6    0xC6    0xF9\
  417. dotaccent    0xFA    0xC7    0xC7    0xFA\
  418. ring    0xFB    0xCA    0xCA    0xFB\
  419. cedilla    0xFC    0xCB    0xCB    0xFC\
  420. hungarumlaut    0xFD    0xCD    0xCD    0xFD\
  421. ogonek    0xFE    0xCE    0xCE    0xFE\
  422. caron    0xFF    0xCF    0xCF    0xFF\
  423.  
  424. \pard\tx3120\tx3620\tx4120\fs16\li2620 \
  425.  
  426. \pard\tx7140\li2100 \
  427. \
  428.  
  429. \fs28 MODIFICATION HISTORY\
  430.  
  431. \fs16 \
  432.  
  433. \pard\tx3120\tx3620\tx4120\fs28\li2620 $Log:    MacToNeXTText.rtf,v $
  434. Revision 1.1  93/01/10  15:08:05  death
  435. Sun Jan 10 15:08:05 PST 1993
  436.  
  437. \fi-20\li3120 \
  438.  
  439. }
  440. @
  441.  
  442.  
  443. 1.1
  444. log
  445. @Sun Jan 10 15:08:05 PST 1993
  446. @
  447. text
  448. @d7 1
  449. a7 1
  450. \pard\tx5700\tx11360\f0\b0\i0\ul0\fs24 $Revision: 1.2 $    $Author: death $    $Date: 92/04/05 22:52:03 $\
  451. d405 4
  452. a408 1
  453. \pard\tx3120\tx3620\tx4120\fs28\li2620 $Log:    $
  454. @
  455.